//类型声明
declare var $: (selector: string) => any;
//修改 body 的背景颜色
$('body').css('background','#aef');

//内置类型的使用
let b: Boolean = true;
let s: String = '精神点';
let s2: String = new String(123);
let reg: RegExp = /\d/;//  let str = 'abc1231';  let reg = /\d/;  reg.exec(str);
let e: Error = new Error('错误');

//BOM 和 DOM 的内置类型
let div: HTMLElement = document.querySelector('#root') as HTMLElement;
let divs: NodeList = document.querySelectorAll('div');

console.log(divs);



